<?php
/**
 * 配置管理
 * @author Ice iceinto@mallog.com.cn
 */
class ConfigModel extends BaseModel
{
    //自动验证
    protected $_validate = array(array("c_k", "require", "键必须！"), 
    array('c_v', 'require', "对应值必须！"));
    public function allUpdate ($data)
    {
        $status = array();
        $udate = array();
        foreach ($data as $k => $v) {
            $udate['c_k'] = $k;
            $udate['c_v'] = $v;
            if ($this->create($udate)) {
                $this->save();
            }else{
                return $this->getError();
            }
        }
    }
}
?>